<?php
declare (strict_types = 1);

namespace app\index\controller;

use tpadmin\model\Config as ConfigModel;
use think\facade\View;

class Index
{
    public function index()
    {
        $config = ConfigModel::where('name',ConfigModel::NAME_SITE_SETTING)->find();
        //dump($congif);
        if (empty($config) || empty($config->value)) {
            $site = [];
        } else {
            $site = json_decode($config->value, true);
        }

        View::assign(['site'  => $site]);
        // 模板输出
        return View::fetch('index');

        //return view('index', [
        //    'site'  => $site,
        //]);
        //return '您好！这是一个[index]示例应用';
    }
}
